package com.bytedance.improvingroad.activity

import android.view.View
import com.bytedance.improvingroad.databinding.ActivityChipBinding

class ChipActivity : BaseBindingActivity<ActivityChipBinding>() {
    override fun initData() {

    }

    override fun initListener() {
        binding.chip.setOnClickListener {
            // 响应点击事件
        }

        binding.chip.setOnCloseIconClickListener {
            // 响应关闭事件，如果有×图标
        }

        binding.chip.setOnCheckedChangeListener { chip, isChecked ->
            // 响应选中事件
        }
        binding.chip.layoutDirection = View.LAYOUT_DIRECTION_LOCALE

        val checkedChipId = binding.chipGroup.checkedChipId // Returns View.NO_ID if singleSelection = false
        val checkedChipIds = binding.chipGroup.checkedChipIds // Returns a list of the selected chips' IDs, if any

        binding.chipGroup.setOnCheckedChangeListener { group, checkedId ->
            // Responds to child chip checked/unchecked
        }
        binding.inputClose.setOnCloseIconClickListener {
            it.visibility = View.GONE
        }
    }
}